package com.hoshino.momochi.model.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;

import java.util.List;

@Data
public class User {
    @TableId(value = "id", type = IdType.AUTO)
//    @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
    private Long id;

    @TableField("username")
    private String username;

    @TableField("password")
    @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
    private String password;

    @TableField("isDelete")
    @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) // 禁止 序列化
    private int isDelete;

    @TableField(exist = false)
    private String token;

    @TableField(exist = false)
    private UserDetails userDetails;

    @TableField(exist = false)
    private List<UserDetails> localDetails; // 我作为关注者，关注的人的信息

    @TableField(exist = false)
    private List<UserDetails> focusDetails; // 我作为被关注者，我的粉丝的信息

    public User(String username, String password) {
        this.username = username;
        this.password = password;
    }
}
